aboutsummaryrefslogtreecommitdiff
path: root/web/pw-server/src/routes/bots/[bot_name]/__layout.svelte
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-11-01 22:36:19 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2022-11-01 22:36:19 +0100
commit0e65f04e1e780865f80660df315e800e6b0cbccd (patch)
tree57672517091ace9b4785c288c8a6335df6bab337 /web/pw-server/src/routes/bots/[bot_name]/__layout.svelte
parent06a8ed945b4c517bb6cf5c84f0d06aa9ede37f11 (diff)
downloadplanetwars.dev-0e65f04e1e780865f80660df315e800e6b0cbccd.tar.xz
planetwars.dev-0e65f04e1e780865f80660df315e800e6b0cbccd.zip
move bot versions to its own tab
Diffstat (limited to 'web/pw-server/src/routes/bots/[bot_name]/__layout.svelte')
-rw-r--r--web/pw-server/src/routes/bots/[bot_name]/__layout.svelte5
1 files changed, 5 insertions, 0 deletions
diff --git a/web/pw-server/src/routes/bots/[bot_name]/__layout.svelte b/web/pw-server/src/routes/bots/[bot_name]/__layout.svelte
index baa8f99..f445cbb 100644
--- a/web/pw-server/src/routes/bots/[bot_name]/__layout.svelte
+++ b/web/pw-server/src/routes/bots/[bot_name]/__layout.svelte
@@ -16,6 +16,8 @@
</script>
<script lang="ts">
+ import { currentUser } from "$lib/stores/current_user";
+
export let bot;
export let owner;
</script>
@@ -36,6 +38,9 @@
<a class="bot-tab" href={`/bots/${bot.name}`}>index</a>
<a class="bot-tab" href={`/bots/${bot.name}/matches`}>matches</a>
<a class="bot-tab" href={`/bots/${bot.name}/stats`}>stats</a>
+ {#if $currentUser && $currentUser["user_id"] === bot["owner_id"]}
+ <a class="bot-tab" href={`/bots/${bot.name}/versions`}>versions</a>
+ {/if}
</div>
</div>
<slot />